package edu.whut.mall.pojo.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * Author: smq
 * Unit: D9lab
 * Date: 2021-06-07 16:15
 */
@Data
@AllArgsConstructor
@Builder
public class ProductSell implements Serializable {
    private static final long serialVersionUID = 9;

    @TableId(type = IdType.AUTO)
    private Integer id;
    private Integer product;
    private Boolean status;//公开赊购/封闭赊购
    private Boolean isDeleted;
    private Date createTime;
    private Date updateTime;
    private Integer num;
    private Integer numRest;
    private Double originalPrice;
    private Double currentPrice;
    private Double supplyPrice;
    private Integer dividendMode;

    public ProductSell() {
        this.createTime = new Date();
    }

    public ProductSell(Integer product, int num, Double originalPrice, Double currentPrice) {
        this.product = product;
        this.num = num;
        this.originalPrice = originalPrice;
        this.currentPrice = currentPrice;
        //其余的相应初始化
        this.status = false;
        this.isDeleted = false;
        this.createTime = new Date();
        this.updateTime = null;
        this.numRest = num;
    }
}